package org.example.component;

import org.apache.dubbo.config.annotation.DubboReference;
import org.example.DemoService;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

//@Component
//public class Task implements CommandLineRunner {
//    @DubboReference
//    private DemoService demoService;
//
//    @Override
//    public void run(String... args) throws Exception {
//        new Thread(() -> {
//            while (true) {
//                try {
//                    Thread.sleep(1000);
//                    System.out.println("received result: " + demoService.sayHello("lace"));
//                } catch (InterruptedException e) {
//                    e.printStackTrace();
//                }
//            }
//        }).start();
//    }
//}
